home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-04-05 | 10.5 KB | 426 lines | [TEXT/PJMM] |
- { This file has been processed by The THINK Pascal Source Converter, v1.1. }
-
- {}
- {Created: Sunday, January 6, 1991 at 10:55 PM}
- { PPCToolBox.p}
- { Pascal Interface to the Macintosh Libraries}
- {}
- { Copyright Apple Computer, Inc. 1989-1990}
- { All rights reserved}
- {}
-
-
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
-
- unit PPCToolBox;
- interface
- uses
- Types, OSUtils, AppleTalk, Memory;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- type
- PPCServiceType = SignedByte;
-
- const
-
- { service Type }
- ppcServiceRealTime = 1;
-
- type
- PPCLocationKind = INTEGER;
-
- const
-
- { lookup Type }
- ppcNoLocation = 0; { There is no PPCLocName }
- ppcNBPLocation = 1; { Use AppleTalk NBP }
- ppcNBPTypeLocation = 2; { Used for specifying a location name type during PPCOpen only }
-
- type
- PPCPortKinds = INTEGER;
-
- const
-
- { port Types }
-
- ppcByCreatorAndType = 1; { PortType is specified as colloquial Mac creator and type }
- ppcByString = 2; { Port Type is in pascal string format }
-
- type
- PPCSessionOrigin = SignedByte; { Values returned for request field in PPCInform call }
-
- const
-
- { Values returned for requestType field in PPCInform call }
- ppcLocalOrigin = 1; { session originated from this machine }
- ppcRemoteOrigin = 2; { session originated from remote machine }
-
- type
- PPCPortRefNum = INTEGER;
- PPCSessRefNum = LONGINT;
-
- PPCPortPtr = ^PPCPortRec;
- PPCPortRec = record
- nameScript: ScriptCode; { script of name }
- name: Str32; { name of port as seen in browser }
- portKindSelector: PPCPortKinds; { which variant }
- case PPCPortKinds of
- ppcByString: (
- portTypeStr: Str32
- );
- ppcByCreatorAndType: (
- portCreator: OSType;
- portType: OSType
- );
- end;
-
- LocationNamePtr = ^LocationNameRec;
- LocationNameRec = record
- locationKindSelector: PPCLocationKind; { which variant }
- case PPCLocationKind of
- ppcNBPLocation: (
- nbpEntity: EntityName
- ); { NBP name entity }
- ppcNBPTypeLocation: (
- nbpType: Str32
- ); { just the NBP type string, for PPCOpen }
- end;
-
- PortInfoPtr = ^PortInfoRec;
- PortInfoRec = record
- filler1: SignedByte;
- authRequired: BOOLEAN;
- name: PPCPortRec;
- end;
-
-
- PortInfoArrayPtr = ^PortInfoArray;
- PortInfoArray = array[0..0] of PortInfoRec;
- PPCFilterProcPtr = ProcPtr;
- {Procedures you will need to write }
- { ex: void MyCompletionRoutine(PPCParamBlkPtr pb) }
- { ex: pascal Boolean MyPortFilter(LocationNamePtr locationName, PortInfoPtr }
- { thePortInfo)}
-
- PPCCompProcPtr = ProcPtr;
-
- PPCOpenPBPtr = ^PPCOpenPBRec;
- PPCOpenPBRec = record
- qLink: Ptr;
- csCode: INTEGER;
- intUse: INTEGER;
- intUsePtr: Ptr;
- ioCompletion: PPCCompProcPtr;
- ioResult: OSErr;
- reserved: array[1..5] of LONGINT; { reserved }
- portRefNum: PPCPortRefNum; { Port Reference }
- filler1: LONGINT;
- serviceType: PPCServiceType;
- resFlag: SignedByte;
- portName: PPCPortPtr; { PortName for PPC }
- locationName: LocationNamePtr;
- networkVisible: BOOLEAN;
- nbpRegistered: BOOLEAN;
- end;
-
- PPCInformPBPtr = ^PPCInformPBRec;
- PPCInformPBRec = record
- qLink: Ptr;
- csCode: INTEGER;
- intUse: INTEGER;
- intUsePtr: Ptr;
- ioCompletion: PPCCompProcPtr;
- ioResult: OSErr;
- reserved: array[1..5] of LONGINT;
- portRefNum: PPCPortRefNum;
- sessRefNum: PPCSessRefNum;
- serviceType: PPCServiceType;
- autoAccept: BOOLEAN;
- portName: PPCPortPtr;
- locationName: LocationNamePtr;
- userName: StringPtr;
- userData: LONGINT;
- requestType: PPCSessionOrigin;
- end;
-
- PPCStartPBPtr = ^PPCStartPBRec;
- PPCStartPBRec = record
- qLink: Ptr;
- csCode: INTEGER;
- intUse: INTEGER;
- intUsePtr: Ptr;
- ioCompletion: PPCCompProcPtr;
- ioResult: OSErr;
- reserved: array[1..5] of LONGINT;
- portRefNum: PPCPortRefNum;
- sessRefNum: PPCSessRefNum;
- serviceType: PPCServiceType;
- resFlag: SignedByte;
- portName: PPCPortPtr;
- locationName: LocationNamePtr;
- rejectInfo: LONGINT;
- userData: LONGINT;
- userRefNum: LONGINT;
- end;
-
- PPCAcceptPBPtr = ^PPCAcceptPBRec;
- PPCAcceptPBRec = record
- qLink: Ptr;
- csCode: INTEGER;
- intUse: INTEGER;
- intUsePtr: Ptr;
- ioCompletion: PPCCompProcPtr;
- ioResult: OSErr;
- reserved: array[1..5] of LONGINT;
- filler1: INTEGER;
- sessRefNum: PPCSessRefNum;
- end;
-
- PPCRejectPBPtr = ^PPCRejectPBRec;
- PPCRejectPBRec = record
- qLink: Ptr;
- csCode: INTEGER;
- intUse: INTEGER;
- intUsePtr: Ptr;
- ioCompletion: PPCCompProcPtr;
- ioResult: OSErr;
- reserved: array[1..5] of LONGINT;
- filler1: INTEGER;
- sessRefNum: PPCSessRefNum;
- filler2: INTEGER;
- filler3: LONGINT;
- filler4: LONGINT;
- rejectInfo: LONGINT;
- end;
-
- PPCWritePBPtr = ^PPCWritePBRec;
- PPCWritePBRec = record
- qLink: Ptr;
- csCode: INTEGER;
- intUse: INTEGER;
- intUsePtr: Ptr;
- ioCompletion: PPCCompProcPtr;
- ioResult: OSErr;
- reserved: array[1..5] of LONGINT;
- filler1: INTEGER;
- sessRefNum: PPCSessRefNum;
- bufferLength: Size;
- actualLength: Size;
- bufferPtr: Ptr;
- more: BOOLEAN;
- filler2: SignedByte;
- userData: LONGINT;
- blockCreator: OSType;
- blockType: OSType;
- end;
-
- PPCReadPBPtr = ^PPCReadPBRec;
- PPCReadPBRec = record
- qLink: Ptr;
- csCode: INTEGER;
- intUse: INTEGER;
- intUsePtr: Ptr;
- ioCompletion: PPCCompProcPtr;
- ioResult: OSErr;
- reserved: array[1..5] of LONGINT;
- filler1: INTEGER;
- sessRefNum: PPCSessRefNum;
- bufferLength: Size;
- actualLength: Size;
- bufferPtr: Ptr;
- more: BOOLEAN;
- filler2: SignedByte;
- userData: LONGINT;
- blockCreator: OSType;
- blockType: OSType;
- end;
-
- PPCEndPBPtr = ^PPCEndPBRec;
- PPCEndPBRec = record
- qLink: Ptr;
- csCode: INTEGER;
- intUse: INTEGER;
- intUsePtr: Ptr;
- ioCompletion: PPCCompProcPtr;
- ioResult: OSErr;
- reserved: array[1..5] of LONGINT;
- filler1: INTEGER;
- sessRefNum: PPCSessRefNum;
- end;
-
- PPCClosePBPtr = ^PPCClosePBRec;
- PPCClosePBRec = record
- qLink: Ptr;
- csCode: INTEGER;
- intUse: INTEGER;
- intUsePtr: Ptr;
- ioCompletion: PPCCompProcPtr;
- ioResult: OSErr;
- reserved: array[1..5] of LONGINT;
- portRefNum: PPCPortRefNum;
- end;
-
- IPCListPortsPBPtr = ^IPCListPortsPBRec;
- IPCListPortsPBRec = record
- qLink: Ptr;
- csCode: INTEGER;
- intUse: INTEGER;
- intUsePtr: Ptr;
- ioCompletion: PPCCompProcPtr;
- ioResult: OSErr;
- reserved: array[1..5] of LONGINT;
- filler1: INTEGER;
- startIndex: INTEGER;
- requestCount: INTEGER;
- actualCount: INTEGER;
- portName: PPCPortPtr;
- locationName: LocationNamePtr;
- bufferPtr: PortInfoArrayPtr;
- end;
-
- PPCParamBlockPtr = ^PPCParamBlockRec;
- PPCParamBlockRec = record
- case Integer of
- 0: (
- openParam: PPCOpenPBRec
- );
- 1: (
- informParam: PPCInformPBRec
- );
- 2: (
- startParam: PPCStartPBRec
- );
- 3: (
- acceptParam: PPCAcceptPBRec
- );
- 4: (
- rejectParam: PPCRejectPBRec
- );
- 5: (
- writeParam: PPCWritePBRec
- );
- 6: (
- readParam: PPCReadPBRec
- );
- 7: (
- endParam: PPCEndPBRec
- );
- 8: (
- closeParam: PPCClosePBRec
- );
- 9: (
- listPortsParam: IPCListPortsPBRec
- );
- end;
-
-
-
- { PPC Calling Conventions }
- function PPCInit: OSErr;
- inline
- $7000, $A0DD, $3E80;
- function PPCOpen (pb: PPCOpenPBPtr; async: BOOLEAN): OSErr;
- function PPCOpenSync (pb: PPCOpenPBPtr): OSErr;
- inline
- $205F, $7001, $A0DD, $3E80;
- function PPCOpenAsync (pb: PPCOpenPBPtr): OSErr;
- inline
- $205F, $7001, $A4DD, $3E80;
- function PPCInform (pb: PPCInformPBPtr; async: BOOLEAN): OSErr;
- function PPCInformSync (pb: PPCInformPBPtr): OSErr;
- inline
- $205F, $7003, $A0DD, $3E80;
- function PPCInformAsync (pb: PPCInformPBPtr): OSErr;
- inline
- $205F, $7003, $A4DD, $3E80;
- function PPCStart (pb: PPCStartPBPtr; async: BOOLEAN): OSErr;
- function PPCStartSync (pb: PPCStartPBPtr): OSErr;
- inline
- $205F, $7002, $A0DD, $3E80;
- function PPCStartAsync (pb: PPCStartPBPtr): OSErr;
- inline
- $205F, $7002, $A4DD, $3E80;
- function PPCAccept (pb: PPCAcceptPBPtr; async: BOOLEAN): OSErr;
- function PPCAcceptSync (pb: PPCAcceptPBPtr): OSErr;
- inline
- $205F, $7004, $A0DD, $3E80;
- function PPCAcceptAsync (pb: PPCAcceptPBPtr): OSErr;
- inline
- $205F, $7004, $A4DD, $3E80;
- function PPCReject (pb: PPCRejectPBPtr; async: BOOLEAN): OSErr;
- function PPCRejectSync (pb: PPCRejectPBPtr): OSErr;
- inline
- $205F, $7005, $A0DD, $3E80;
- function PPCRejectAsync (pb: PPCRejectPBPtr): OSErr;
- inline
- $205F, $7005, $A4DD, $3E80;
- function PPCWrite (pb: PPCWritePBPtr; async: BOOLEAN): OSErr;
- function PPCWriteSync (pb: PPCWritePBPtr): OSErr;
- inline
- $205F, $7006, $A0DD, $3E80;
- function PPCWriteAsync (pb: PPCWritePBPtr): OSErr;
- inline
- $205F, $7006, $A4DD, $3E80;
- function PPCRead (pb: PPCReadPBPtr; async: BOOLEAN): OSErr;
- function PPCReadSync (pb: PPCReadPBPtr): OSErr;
- inline
- $205F, $7007, $A0DD, $3E80;
- function PPCReadAsync (pb: PPCReadPBPtr): OSErr;
- inline
- $205F, $7007, $A4DD, $3E80;
- function PPCEnd (pb: PPCEndPBPtr; async: BOOLEAN): OSErr;
- function PPCEndSync (pb: PPCEndPBPtr): OSErr;
- inline
- $205F, $7008, $A0DD, $3E80;
- function PPCEndAsync (pb: PPCEndPBPtr): OSErr;
- inline
- $205F, $7008, $A4DD, $3E80;
- function PPCClose (pb: PPCClosePBPtr; async: BOOLEAN): OSErr;
- function PPCCloseSync (pb: PPCClosePBPtr): OSErr;
- inline
- $205F, $7009, $A0DD, $3E80;
- function PPCCloseAsync (pb: PPCClosePBPtr): OSErr;
- inline
- $205F, $7009, $A4DD, $3E80;
- function IPCListPorts (pb: IPCListPortsPBPtr; async: BOOLEAN): OSErr;
- function IPCListPortsSync (pb: IPCListPortsPBPtr): OSErr;
- inline
- $205F, $700A, $A0DD, $3E80;
- function IPCListPortsAsync (pb: IPCListPortsPBPtr): OSErr;
- inline
- $205F, $700A, $A4DD, $3E80;
- function DeleteUserIdentity (userRef: LONGINT): OSErr;
- function GetDefaultUser (var userRef: LONGINT; var userName: Str32): OSErr;
- function StartSecureSession (pb: PPCStartPBPtr; var userName: Str32; useDefault: BOOLEAN; allowGuest: BOOLEAN; var guestSelected: BOOLEAN; prompt: Str255): OSErr;
- function PPCBrowser (prompt: Str255; applListLabel: Str255; defaultSpecified: BOOLEAN; var theLocation: LocationNameRec; var thePortInfo: PortInfoRec; portFilter: PPCFilterProcPtr; theLocNBPType: Str32): OSErr;
- inline
- $303C, $0D00, $A82B;
-
-
- { UsingPPCToolBox }
-
-
- implementation
- end.
-
-